home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / misc-part2 / 12350 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: combo.ganesha.com!peterk
  2. From: peterk@combo.ganesha.com (Dr. Peter Kittel)
  3. Subject: Re: Amigados - checking f
  4. Newsgroups: comp.sys.amiga.misc
  5. Reply-To: peterk@combo.ganesha.com
  6. References: <401.6670T240T431@nibelung.demon.co.uk> <8290833353303@shoestring.opus-networx.com>
  7. Message-ID: <peterk.0mrv@combo.ganesha.com>
  8. Date: 12 Apr 96 23:04:17 MEZ
  9. Organization: Private Site
  10.  
  11. In article <8290833353303@shoestring.opus-networx.com> dnn@shoestring.opus-networx.com (Amigaboy) writes:
  12. >
  13. > > What would be the format to check the existence of a file in a script for
  14. > > dos?  I would have thought something like this:
  15. > > 
  16. > > If EXISTS blah:filename
  17. > >   dowhatever
  18. > >   else
  19. > >    dothatinstead
  20. > >    endif
  21. > > endif
  22. > > 
  23. > > but this doesn't work.
  24. >
  25. >  Barry, try using 'FailAt 21' before the IF EXISTS so-so-so.  If blah:filename
  26. >  was not found a non-zero return code (20) for the command would be returned
  27. >  causing your script to fail.
  28.  
  29. Sorry, this is wrong. The If is exactly thought for these cases and
  30. will not fail. Only one other fatal situation can occur, when there
  31. is no drive (or assignment for) blah:. Then a requester would pop up
  32. asking you to insert volume blah:. To prevent even this, you could
  33. precede all this with a check by "Assign blah: Exists" an a following
  34. "If Warn ...".
  35.  
  36. -- 
  37. Best Regards, Dr. Peter Kittel       //    Visit  http://www.amiga.de
  38. Private Site in Frankfurt, Germany \X/  Email to: peterk@combo.ganesha.com
  39. Employed at AMIGA Technologies GmbH in Bensheim, Germany
  40.